package cn.home.sysmanagement.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.home.sysmanagement.mapper.HomeMessageMapper;
import cn.home.sysmanagement.domain.HomeMessage;
import cn.home.sysmanagement.service.IHomeMessageService;

/**
 * 公告Service业务层处理
 * 
 * @author homedoctor
 * @date 2025-04-10
 */
@Service
public class HomeMessageServiceImpl implements IHomeMessageService 
{
    @Autowired
    private HomeMessageMapper homeMessageMapper;

    /**
     * 查询公告
     * 
     * @param id 公告主键
     * @return 公告
     */
    @Override
    public HomeMessage selectHomeMessageById(Long id)
    {
        return homeMessageMapper.selectHomeMessageById(id);
    }

    /**
     * 查询公告列表
     * 
     * @param homeMessage 公告
     * @return 公告
     */
    @Override
    public List<HomeMessage> selectHomeMessageList(HomeMessage homeMessage)
    {
        return homeMessageMapper.selectHomeMessageList(homeMessage);
    }

    /**
     * 新增公告
     * 
     * @param homeMessage 公告
     * @return 结果
     */
    @Override
    public int insertHomeMessage(HomeMessage homeMessage)
    {
        homeMessageMapper.insertHomeMessage(homeMessage);
        return homeMessage.getId().intValue();
    }

    /**
     * 修改公告
     * 
     * @param homeMessage 公告
     * @return 结果
     */
    @Override
    public int updateHomeMessage(HomeMessage homeMessage)
    {
        return homeMessageMapper.updateHomeMessage(homeMessage);
    }

    /**
     * 批量删除公告
     * 
     * @param ids 需要删除的公告主键
     * @return 结果
     */
    @Override
    public int deleteHomeMessageByIds(Long[] ids)
    {
        return homeMessageMapper.deleteHomeMessageByIds(ids);
    }

    /**
     * 删除公告信息
     * 
     * @param id 公告主键
     * @return 结果
     */
    @Override
    public int deleteHomeMessageById(Long id)
    {
        return homeMessageMapper.deleteHomeMessageById(id);
    }
}
